/*
 * @Descripttion:编辑器中间iframe画布区域，渲染楼层主入口
 */
import React, { useEffect, useState } from 'react'
import { BuiltInComponents } from '@modules/components'
import { DecorateContainerFloorList } from '@conecli/cone-render/modules'
import './index.module.scss'

document.domain = "jd.com";
// 获取挂在父页面cone window上的 messager，通过它实现通信
const Messager = window.top._coneMessager
// 装修画布
const DecorateCanvas = (props) => {

  useEffect(() => {
    Messager?.trigger('iframeDidRender', { isFirst: true })
  }, [])
  window.top.jsonRenderMessager = null
  return <DecorateContainerFloorList
    {...props}
    builtInComponents={BuiltInComponents}
  />
}

export default DecorateCanvas
